****************************************************************************
*``The Costs and Environmental Justice Concerns of NIMBY in Solid Waste Disposal''*
* Phuong Ho (SNF-Centre for Applied Research in Norwegian School of Economics) *
*******************************************************************************
*** This file makes Table E4 ***********
cls
clear all 
capture log close
set more off

global mydir "C:\XYZ" // set working directory
global data "$mydir\data"
global matlabin "$mydir\matlab\input"
global result "$mydir\TEX\"
cd "$mydir\stata"
set matsize 11000
set maxvar 32700
******************* TABLE E4 ***************************************
local scenario "importBan importTax"

**************************************************************************
**** BUILD THE SAMPLE. IMPORT STATUS QUO ESTIMATES **************************
***************************************************************************
import excel "$mydir\matlab\output\nimby_statusquo.xlsx", sheet("Sheet1") firstrow clear
label var sj_q "market size"
label var pr "model implied market share"
label var Bq "model implied trash amount"
label var el "price elasticity"
label var CS "hauler's surplus"
sort TCJ
cap drop O_CO* D_CO* D_B*
save nimby_counterfactual, replace

**************************************************************************
****** IMPORT DEMOGRAPHICS IN 5-MILE COMMUNITIES *************************
***************************************************************************
*****************************************************************************
// 1/3. Import demographics for county of origin 
use $data\demographics\raw\county_demographics_2010_CA, clear
keep *geoid *name *pop *white* *black* *hispanic* *asian* *mdhhinc
foreach x of varlist _all {
	rename `x' O_`x'
} 
rename O_COname county
gen year=2010
sort year county
tempfile tmp
save `tmp', replace
use nimby_counterfactual, clear
sort year county
merge m:1 year county using `tmp'
erase `tmp'
drop if _merge==2 //_merge==1 are not 2010, _merge==2 are counties that doesn't generate trash in 2010
drop _merge
replace O_COmdhhinc=O_COmdhhinc*index2000
save nimby_counterfactual, replace

// 2/3. Import demographics for county of destination 
use $data\demographics\raw\county_demographics_2010_CA, clear
keep *geoid *name *pop *white* *black* *hispanic* *asian* *mdhhinc
foreach x of varlist _all {
	rename `x' D_`x'
} 
rename D_COname descnty
gen year=2010
sort year descnty
tempfile tmp
save `tmp', replace
use nimby_counterfactual, clear
sort year descnty
merge m:1 year descnty using `tmp'
erase `tmp'
drop if _merge==2 //_merge==1 are not 2010, _merge==2 are counties that doesn't generate trash in 2010
drop _merge
replace D_COmdhhinc=D_COmdhhinc*index2000
save nimby_counterfactual, replace

// 3/3. Import demographics for community of destination
use $data\buffer\demographics_buffer_5mile, clear
keep code year Bpop B0pop Bwhite Bblack Basian Bhispanic Bmdhhinc
local varl "white black asian hispanic"
foreach v in `varl' {
  gen B`v'_p=B`v'*100/Bpop
}
foreach x of varlist _all {
	rename `x' D_`x'
} 
rename D_code Code
rename D_year year
sort year Code
tempfile tmp
save `tmp', replace
use nimby_counterfactual, clear
sort year Code
merge m:1 year Code using `tmp'
erase `tmp'
drop if _merge==2 //_merge==1 must be 0 if analyzing at other years, _merge==2 are counties that doesn't generate trash in 2010
drop _merge
replace D_Bmdhhinc=D_Bmdhhinc*index2000 if year==2010  // adjust income to 2000 dollars

replace D_Bpop=0 if D_Bpop==. & year==2010 & oos==0
sum D_Bpop if year==2010 // check if there is affected community noone lives in
local r = r(min)
if `r'==0 {
replace D_Bmdhhinc=0 if D_Bpop==0 & oos==0 & year==2010
replace D_B0pop=1 if D_Bpop==0 & oos==0 & year==2010
local varv "black white hispanic asian"
foreach v in `varv' {
replace D_B`v'=0 if D_Bpop==0 & oos==0 & year==2010
replace D_B`v'_p=0 if D_Bpop==0 & oos==0 & year==2010
}
}

save nimby_counterfactual, replace

************************************************************************
***** SUMMARY STATISTICS OF DEMOGRAPHICS IN 2-MILE COMMUNITIES *******
******** TABLE E4: PANEL A ****************************************************
use nimby_counterfactual, clear
di "Table E4: Panel A"
sum D_Bpop D_Bwhite D_Bblack D_Bhispanic D_Basian D_Bwhite_p D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc if year==2010
sum D_Bpop D_Bwhite D_Bblack D_Bhispanic D_Basian D_Bwhite_p D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc [iw=q] if year==2010 
	
***** CURRENT DISTRIBUTION OF WASTE DISPOSAL BY RACE ****************
****** TABLE E4: PANEL B *******************************************************
cap gen D_Bmdhhinc000=D_Bmdhhinc/1000
sum D_Bpop // check if there is affected community noone lives in
local r = r(min)
if `r'==0 {
replace D_Bmdhhinc=0 if D_Bmdhhinc==.
replace D_Bmdhhinc000=0 if D_Bmdhhinc000==.
replace D_Bblack_p=0 if D_Bblack_p==.
replace D_Bwhite_p=0 if D_Bwhite_p==.
replace D_Bhispanic_p=0 if D_Bhispanic_p==.
replace D_Basian_p=0 if D_Basian_p==.
}
di "Table E4: Panel B"
eststo clear
tobit share00  D_Bblack_p D_Bhispanic_p D_Basian_p i.T i.C if year==2010 [pw=mktsize], ll vce(cluster J)
eststo mod1
tobit share00 D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc000 i.T i.C if year==2010  [pw=mktsize], ll vce(cluster J)
eststo mod2
tobit share00 D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc000 realprice i.T i.C if year==2010 [pw=mktsize], ll vce(cluster J)
eststo mod3
tobit share00 D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc000 realprice dridis i.T i.C if year==2010 [pw=mktsize], ll vce(cluster J)
eststo mod4
tobit share00 D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc000 realprice dridis Access2 i.T i.C if year==2010 [pw=mktsize], ll vce(cluster J)
eststo mod5
tobit share00  D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc000 realprice dridis Access2 Operation1 i.T i.C if year==2010 [pw=mktsize], ll vce(cluster J)
eststo mod6
tobit share00  D_Bblack_p D_Bhispanic_p D_Basian_p D_Bmdhhinc000 realprice dridis Access2 Operation1 DaysYear i.T i.C if year==2010 [pw=mktsize], ll vce(cluster J)
eststo mod7
esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 using "$result\tableE4_panelB.tex" , replace  se(2) ar2 nonotes scalars(N_unc ll) compress b(2) nogaps  ///
		title("Tobit share with origin cnty FE, weighted by market size") ///
				mtitle() ///
		star(* 0.10 ** 0.05 *** 0.01)  ///
		drop(_cons *T* *C*) ///
		prefoot(\hline  "quarter FE & Y  & Y & Y & Y  & Y & Y & Y & Y  " \\ ///
					"ori cnty FE & Y  & Y & Y & Y  & Y & Y & Y & Y  " \\ \hline ) 					
	
***************************************************************************
**** NOW, PANEL C ****************************

use nimby_counterfactual, clear
bys year Code: gen dupj=cond(_N==1,0,_n)
bys year county: gen dupc=cond(_N==1,0,_n)
bys year descnty: gen dupd=cond(_N==1,0,_n)
bys year quarter county: gen duptc=cond(_N==1,0,_n)
save nimby_counterfactual, replace
use nimby_counterfactual, clear 

***************************************************************************
***********
******** RESULTS: COUNTERFACTUAL WITH PRICE ADJUSTMENT *************
**************
**************************************************************************
foreach s in `scenario' {
	if "`s'"=="importBan" {
****1. IMPORT DATA OF COUNTERFACTUAL SCENARIO ***********
import excel "$mydir\matlab\output\nimby_counterfactual_`s'_with_eqprice.xlsx", sheet("Sheet1") firstrow clear
keep year quarter county Code Cpr Cq CCS
sort year quarter county Code
tempfile tmp
save `tmp', replace
use nimby_counterfactual, clear 
replace TC=99999 if localf==0
sort year county
by year county: egen slocal=total(localf)
replace slocal=1 if slocal>0 & slocal<. // whether a county has a local facility
rename slocal havef
sort year quarter county Code
merge 1:1 year quarter county Code using `tmp', force
drop _merge
erase `tmp'
**Adjust and rename realprice, dridis, diesel price depending on counterfactual************
gen Nrealprice=realprice
replace Nrealprice=Nrealprice 

gen Ndridis=dridis

*********************************CORRECT VARIABLES *************************
*use trash_distn_counterfactual, clear
*Correct rounding errors for the ban. After the ban, trash must be dumped locally 
gen DEL_q=Cq-Bq
gen Nq=q+DEL_q/Bq*q
replace Nq=0 if DEL_q<=1e-2 & q==0
replace Nq=Cq-Bq if DEL_q>1e-2 & q==0
replace Nq=0 if localf==0
gen Dq=Nq-q

*** DISTRIBUTIONAL EFFECTS. TABLE 6  ***************************************
keep if year==2010
bys year county: egen havelocalc=total(localf)
replace havelocalc=1 if havelocalc>0 & havelocalc<.
sort year county Code
by year county Code: gen yjdup=cond(_N==1,0,_n)
by year county Code: egen yjaq=total(Bq) // receiving q at year-county level
by year county Code: egen yjoq_del=total(Bq) if localf==0
by year county Code: egen yjoq=mean(yjoq_del)
sort year county Code
by year county Code: egen yjaNq=total(Cq) // receiving q at year-county level
by year county Code: egen yjoNq_del=total(Cq) if localf==0
by year county Code: egen yjoNq=mean(yjoNq_del)
drop *_del
sort year county
by year county: egen yQ=total(Bq)
by year county: egen tcq=total(Bq)
by year county: egen yNQ=total(Cq)

*trash going to places where noone lives
by year county: egen qTo0pop_del=total(yjaq) if yjdup<=1 & D_Bpop==0
by year county: egen qTo0pop=mean(qTo0pop_del)
replace qTo0pop=0 if qTo0pop==.
gen qTo0poppc=qTo0pop/yQ*100

by year county: egen NqTo0pop_del=total(yjaNq) if yjdup<=1 & D_Bpop==0
by year county: egen NqTo0pop=mean(NqTo0pop_del)
replace NqTo0pop=0 if NqTo0pop==.
gen NqTo0poppc=NqTo0pop/yNQ*100
gen DqTo0poppc=NqTo0poppc-qTo0poppc

** Testing 2nd method. Again, still be % trash of a county to its destined facilities
by year county: egen qExport_del=total(Bq) if localf==0
by year county: egen qExport=mean(qExport_del)
drop *_del
by year county: egen NqExport_del=total(Cq) if localf==0
by year county: egen NqExport=mean(NqExport_del)
drop *_del

sort year county Code quarter
local varl "white black asian hispanic"
foreach v in `varl' {
	gen q`v'=Bq/D_Bpop*D_B`v' // waste exposed to local residents at facility
	*Calculate total waste exposed as total generated in a county
	by year county: egen c_q`v'=total(q`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year county: egen c_o`v'_del=total(q`v') if localf==0 // exports
	by year county: egen c_o`v'=mean(c_o`v'_del)
	replace c_o`v'=0 if c_o`v'==. // some county does not export
	gen Pc_q`v'=c_q`v'/yQ*100 // % of generated waste disposed of at `v'
	gen Pc_o`v'=c_o`v'/yQ*100
	gen Pce_o`v'=c_o`v'/qExport*100
}
local varl "white black asian hispanic"
foreach v in `varl' {
	gen Nq`v'=Cq/D_Bpop*D_B`v' // waste exposed to local residents at facility
	*Calculate total waste exposed as total generated in a county
	by year county: egen c_Nq`v'=total(Nq`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year county: egen c_No`v'_del=total(Nq`v') if localf==0 // exports
	by year county: egen c_No`v'=mean(c_No`v'_del)
	replace c_No`v'=0 if c_No`v'==. // some county does not export
	gen Pc_Nq`v'=c_Nq`v'/yNQ*100 // % of generated waste disposed of at `v'
	gen Pc_No`v'=c_No`v'/yNQ*100
	gen Pce_No`v'=c_No`v'/NqExport*100
}
drop *_del
local varl "white black asian hispanic"
foreach v in `varl' {
	gen DPc_q`v'=Pc_Nq`v'-Pc_q`v'
	gen DPc_o`v'=Pc_No`v'-Pc_o`v'
	gen DPce_o`v'=Pce_No`v'-Pce_o`v'
}

**** % of total waste generated in CA ******************
by year: egen CAq_del=total(Bq) if desco~="oos"
by year: egen CAq=mean(CAq_del) 
by year: egen CANq_del=total(Cq) if desco~="oos"
by year: egen CANq=mean(CANq_del)
**Total intercounty in CA
bys year: egen interq_del=total(Bq) if localf==0 & j~="oos"
bys year: egen interq=mean(interq_del)
bys year: egen Ninterq_del=total(Cq) if localf==0 & j~="oos"
bys year: egen Ninterq=mean(Ninterq_del)
drop *_del

local varl "white black asian hispanic"
foreach v in `varl' {
	*Calculate total waste exposed as total generated in CA
	by year: egen CA_q`v'=total(q`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year: egen CA_o`v'_del=total(q`v') if localf==0 // exports
	by year: egen CA_o`v'=mean(CA_o`v'_del)
	gen PCA_q`v'=CA_q`v'/CAq*100 // % of generated waste disposed of at `v'
	gen PCA_o`v'=CA_o`v'/CAq*100
	gen PCAi_o`v'=CA_o`v'/interq*100
	
	by year: egen CA_Nq`v'=total(Nq`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year: egen CA_No`v'_del=total(Nq`v') if localf==0 // exports
	by year: egen CA_No`v'=mean(CA_No`v'_del)
	gen PCA_Nq`v'=CA_Nq`v'/CANq*100 // % of generated waste disposed of at `v'
	gen PCA_No`v'=CA_No`v'/CANq*100 // out-of-county as % of total q
	gen PCAi_No`v'=CA_No`v'/Ninterq*100	// out-of-county as % of interq
}
drop *_del
local varl "white black asian hispanic"
foreach v in `varl' {
	gen DPCA_q`v'=PCA_Nq`v'-PCA_q`v'
	gen DPCA_o`v'=PCA_No`v'-PCA_o`v'
	gen DPCAi_o`v'=PCAi_No`v'-PCAi_o`v'
}


by year: egen CAqto0pop_del=total(Bq) if D_Bpop==0 & desco~="oos"
by year: egen CAqto0pop=mean(CAqto0pop_del)
replace CAqto0pop=0 if CAqto0pop==.
gen CAqto0poppc=CAqto0pop/CAq*100

by year: egen NCAqto0pop_del=total(Cq) if D_Bpop==0 & desco~="oos"
by year: egen NCAqto0pop=mean(NCAqto0pop_del)
replace NCAqto0pop=0 if NCAqto0pop==.
gen NCAqto0poppc=NCAqto0pop/CAq*100
gen DCAqto0poppc=NCAqto0poppc-CAqto0poppc
drop *_del

di "This is the result of counterfactual (with price adjustment) of scenario:"
di "`s'"
di "Panel C. Column 1. Change in % of waste after import bans"
sum PCA_qwhite PCA_qblack PCA_qasian PCA_qhispanic ///
	DPCA_qwhite DPCA_qblack DPCA_qasian DPCA_qhispanic ///
	PCA_owhite PCA_oblack PCA_oasian PCA_ohispanic ///
	DPCA_owhite DPCA_oblack DPCA_oasian DPCA_ohispanic ///
	CAqto0poppc DCAqto0poppc [iw=tcq] if year==2010 & dupc<=1 & havelocalc==1

} // ending "`s'"=="importBan"
******************************************************************************
************ OTHER COUNTERFACTUALS THAN IMPORT BAN ***************************
******************************************************************************
if "`s'"!="importBan" {
**** Calculate baseline level *********
****1. IMPORT DATA OF COUNTERFACTUAL SCENARIO ***********

import excel "$mydir\matlab\output\nimby_counterfactual_`s'_with_eqprice.xlsx", sheet("Sheet1") firstrow clear
keep year quarter county Code Cpr Cq CCS
sort year quarter county Code
tempfile tmp
save `tmp', replace
use nimby_counterfactual, clear 
sort year quarter county Code
merge 1:1 year quarter county Code using `tmp', force
drop _merge
erase `tmp'
**Adjust and rename realprice, dridis, diesel price depending on counterfactual************
gen Nrealprice=realprice
if "`s'"=="importTax" {
replace Nrealprice=Nrealprice*1.10  if localf==0
}
if "`s'"=="trashTax" {
replace Nrealprice=Nrealprice*1.10
}
*mile tax affects share and flows, not directly on price or distance
gen Ndridis=dridis
gen DEL_q=Cq-Bq
gen Nq=q+DEL_q/Bq*q
replace Nq=0 if DEL_q<=1e-2 & q==0
replace Nq=Cq-Bq if DEL_q>1e-2 & q==0
replace Nq=0 if localf==0
gen Dq=Nq-q

*** DISTRIBUTIONAL EFFECTS  ***************************************
keep if year==2010
bys year county: egen havelocalc=total(localf)
replace havelocalc=1 if havelocalc>0 & havelocalc<.
sort year county Code
by year county Code: gen yjdup=cond(_N==1,0,_n)
by year county Code: egen yjaq=total(Bq) // receiving q at year-county level
by year county Code: egen yjoq_del=total(Bq) if localf==0
by year county Code: egen yjoq=mean(yjoq_del)
sort year county Code
by year county Code: egen yjaNq=total(Cq) // receiving q at year-county level
by year county Code: egen yjoNq_del=total(Cq) if localf==0
by year county Code: egen yjoNq=mean(yjoNq_del)
drop *_del
sort year county
by year county: egen yQ=total(Bq)
by year county: egen tcq=total(Bq)
by year county: egen yNQ=total(Cq)

*trash going to places where noone lives
by year county: egen qTo0pop_del=total(yjaq) if yjdup<=1 & D_Bpop==0
by year county: egen qTo0pop=mean(qTo0pop_del)
replace qTo0pop=0 if qTo0pop==.
gen qTo0poppc=qTo0pop/yQ*100

by year county: egen NqTo0pop_del=total(yjaNq) if yjdup<=1 & D_Bpop==0
by year county: egen NqTo0pop=mean(NqTo0pop_del)
replace NqTo0pop=0 if NqTo0pop==.
gen NqTo0poppc=NqTo0pop/yNQ*100
gen DqTo0poppc=NqTo0poppc-qTo0poppc

** Testing 2nd method. Again, still be % trash of a county to its destined facilities
by year county: egen qExport_del=total(Bq) if localf==0
by year county: egen qExport=mean(qExport_del)
drop *_del
by year county: egen NqExport_del=total(Cq) if localf==0
by year county: egen NqExport=mean(NqExport_del)
drop *_del

sort year county Code quarter
local varl "white black asian hispanic"
foreach v in `varl' {
	gen q`v'=Bq/D_Bpop*D_B`v' // waste exposed to local residents at facility
	*Calculate total waste exposed as total generated in a county
	by year county: egen c_q`v'=total(q`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year county: egen c_o`v'_del=total(q`v') if localf==0 // exports
	by year county: egen c_o`v'=mean(c_o`v'_del)
	replace c_o`v'=0 if c_o`v'==. // some county does not export
	gen Pc_q`v'=c_q`v'/yQ*100 // % of generated waste disposed of at `v'
	gen Pc_o`v'=c_o`v'/yQ*100
	gen Pce_o`v'=c_o`v'/qExport*100
}
local varl "white black asian hispanic"
foreach v in `varl' {
	gen Nq`v'=Cq/D_Bpop*D_B`v' // waste exposed to local residents at facility
	*Calculate total waste exposed as total generated in a county
	by year county: egen c_Nq`v'=total(Nq`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year county: egen c_No`v'_del=total(Nq`v') if localf==0 // exports
	by year county: egen c_No`v'=mean(c_No`v'_del)
	replace c_No`v'=0 if c_No`v'==. // some county does not export
	gen Pc_Nq`v'=c_Nq`v'/yNQ*100 // % of generated waste disposed of at `v'
	gen Pc_No`v'=c_No`v'/yNQ*100
	gen Pce_No`v'=c_No`v'/NqExport*100
}
drop *_del
local varl "white black asian hispanic"
foreach v in `varl' {
	gen DPc_q`v'=Pc_Nq`v'-Pc_q`v'
	gen DPc_o`v'=Pc_No`v'-Pc_o`v'
	gen DPce_o`v'=Pce_No`v'-Pce_o`v'
}

**** % of total waste generated in CA ******************
by year: egen CAq_del=total(Bq) if desco~="oos"
by year: egen CAq=mean(CAq_del) 
by year: egen CANq_del=total(Cq) if desco~="oos"
by year: egen CANq=mean(CANq_del)
**Total intercounty in CA
bys year: egen interq_del=total(Bq) if localf==0 & j~="oos"
bys year: egen interq=mean(interq_del)
bys year: egen Ninterq_del=total(Cq) if localf==0 & j~="oos"
bys year: egen Ninterq=mean(Ninterq_del)
drop *_del

local varl "white black asian hispanic"
foreach v in `varl' {
	*Calculate total waste exposed as total generated in CA
	by year: egen CA_q`v'=total(q`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year: egen CA_o`v'_del=total(q`v') if localf==0 // exports
	by year: egen CA_o`v'=mean(CA_o`v'_del)
	gen PCA_q`v'=CA_q`v'/CAq*100 // % of generated waste disposed of at `v'
	gen PCA_o`v'=CA_o`v'/CAq*100
	gen PCAi_o`v'=CA_o`v'/interq*100
	
	by year: egen CA_Nq`v'=total(Nq`v')  // total generated waste
	// exports. Calculate total waste exposure as exports
	by year: egen CA_No`v'_del=total(Nq`v') if localf==0 // exports
	by year: egen CA_No`v'=mean(CA_No`v'_del)
	gen PCA_Nq`v'=CA_Nq`v'/CANq*100 // % of generated waste disposed of at `v'
	gen PCA_No`v'=CA_No`v'/CANq*100 // out-of-county as % of total q
	gen PCAi_No`v'=CA_No`v'/Ninterq*100	// out-of-county as % of interq
}
drop *_del
local varl "white black asian hispanic"
foreach v in `varl' {
	gen DPCA_q`v'=PCA_Nq`v'-PCA_q`v'
	gen DPCA_o`v'=PCA_No`v'-PCA_o`v'
	gen DPCAi_o`v'=PCAi_No`v'-PCAi_o`v'
}

by year: egen CAqto0pop_del=total(Bq) if D_Bpop==0 & desco~="oos"
by year: egen CAqto0pop=mean(CAqto0pop_del)
replace CAqto0pop=0 if CAqto0pop==.
gen CAqto0poppc=CAqto0pop/CAq*100

by year: egen NCAqto0pop_del=total(Cq) if D_Bpop==0 & desco~="oos"
by year: egen NCAqto0pop=mean(NCAqto0pop_del)
replace NCAqto0pop=0 if NCAqto0pop==.
gen NCAqto0poppc=NCAqto0pop/CAq*100
gen DCAqto0poppc=NCAqto0poppc-CAqto0poppc
drop *_del

di "This is the result of counterfactual (with price adjustment) of scenario:"
di "`s'"
di "Panel C. Column 1. Change in % of waste after import taxes"
sum PCA_qwhite PCA_qblack PCA_qasian PCA_qhispanic ///
	DPCA_qwhite DPCA_qblack DPCA_qasian DPCA_qhispanic ///
	PCA_owhite PCA_oblack PCA_oasian PCA_ohispanic ///
	DPCA_owhite DPCA_oblack DPCA_oasian DPCA_ohispanic ///
	CAqto0poppc DCAqto0poppc [iw=tcq] if year==2010 & dupc<=1 & havelocalc==1

 } // ending "`s'"!="importBan"
  
} // ending foreach s in `scenario'

